package com.wgke.bluetooth.ui;

import android.content.Context;
import android.content.Intent;

import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.wgke.bluetooth.R;
import com.wgke.bluetooth.ui.fragment.HeatMap2DFragment;
import com.wgke.bluetooth.ui.fragment.HeatMap3DFragment;
import com.wgke.bluetooth.vm.BaseVM;

public class HeatMapActivity extends BaseActivity<BaseVM> {


    public static void start(Context context,int type){
        Intent intent = new Intent(context,HeatMapActivity.class);
        intent.putExtra("type",type);
        context.startActivity(intent);
    }
    @Override
    public int layoutId() {
        return R.layout.activity_common;
    }

    @Override
    public void initView() {
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction transaction = fm.beginTransaction();
        if (getIntent().getIntExtra("type", 0) == 1) {
            transaction.add(R.id.linearLayout, new HeatMap3DFragment());
        } else transaction.add(R.id.linearLayout, new HeatMap2DFragment());
        transaction.addToBackStack(null); // Optional: Add to back stack
        transaction.commit();
    }

    @Override
    public boolean isUseEventBus() {
        return false;
    }


}
